<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

// CI defaults
$route['default_controller']  = "route_router";
$route['scaffolding_trigger'] = "";

// bricabox schtuff
$route['private']			  = "bricaboxcontroller/private_home";
$route['random']			  = "bricaboxcontroller/random";
$route['edit_layout'] 		  = "route_router";
$route['activity']	 		  = "bricaboxcontroller/all_activity";
$route['new/([_a-z]+)']		  = "bricaboxcontroller/new_bricabox_landing";

// sitemap
$route['sitemap.xml'] 		= "content/sitemap";
$route['sitemap_index.xml'] = "content/sitemap_index";

// Static about pages route
$route['about/:any'] 		 = "pagecontroller/show_page";
$route['pages/user_section'] = "pagecontroller/user_section";
//$route['new_home']			 = "route_router/new_home";

// sign up, log in, log out are unified on one screen
foreach (array('sign_up_or_log_in', 'log_out') as $action)
{
	$route[$action] = "account/{$action}";
}

// profiles
$route['superstar/:any'] 	= "account/superstar";
$route['person/:any/:num'] 	= "account/global_profile";
$route['person/:any'] 		= "account/global_profile";
$route['member/:any/:num'] 	= "account/member_profile";
$route['member/:any'] 		= "account/member_profile";

$route['follow/:any/:any'] = "account/follow";

// admin
$route['admin'] 				 = "bricaboxadmin/index";
$route['admin/general/([a-z]+)'] = "bricaboxadmin/gen_$1";

foreach (array('general', 'entry_templates', 'members', 'entries', 'layout', 'stats',
				'create_entry_template', 'save_entry_template',
				'change_member_role', 'add_member', 'remove_application',
				'flagged_entries') as $action)
{
	$route["admin/{$action}"] = "bricaboxadmin/{$action}";
}
$route['admin/remove_flags/:num']				= "bricaboxadmin/remove_flags";
$route["admin/remove_member/:num/:num"] 		= "bricaboxadmin/remove_member"; 		 // admin/remove_member/bricabox_id/user_id
$route["admin/delete_entry_template/:num/:num"] = "bricaboxadmin/delete_entry_template"; // admin/delete_entry_template/bricabox_id/tpl_id

// bricabox
$route['bricabox/(\d+)/clone'] 		 = "bricaboxcontroller/clone_bricabox";
$route['bricabox/(\d+)/([_a-z]+)']   = "bricaboxcontroller/$2";
$route['bricabox/(\d+)/remove_link/:num/:num/:any'] = "bricaboxcontroller/remove_link";
$route['assets/css/custom_css/:num'] = "bricaboxcontroller/custom_css"; // the :num segment is just a timestamp
$route['join_up']					 = "bricaboxcontroller/join_up";
$route['leave']						 = "bricaboxcontroller/leave";

// bricabox > search
$route['search'] = "bricaboxcontroller/search";

// content (entries)
$route['entries.xml']		= "content/list_content"; // mildly RESTful
$route['entries']			= "content/list_content";
$route['entries/(.*)']		= "content/list_content";
$route['content/:num/flag'] = "content/flag_content";
$route['content/:num/edit'] = "content/edit";
$route['content/:num/destroy'] 		= "content/destroy";
$route['content/:num/edit_layout']  = "content/show";
$route['content/:num/([-a-zA-Z0-9]+)'] = "content/show"; // SEO-friendly
$route['content/:num']		= "content/show";
$route['entry_tpl_fields'] 	= "content/entry_tpl_fields";
$route['content/:num/load_wiki_version/:num'] 		 = "content/load_wiki_version";
$route['content/:num/set_default_wiki_version/:num'] = "content/set_default_wiki_version";

// superadmin pages
$route['stats'] 	 		= "pagecontroller/admin_stats";
$route['status_msg'] 		= "pagecontroller/status_msg";
$route['list_everything'] 	= "pagecontroller/admin_userlist";

// members
$route['members'] = "bricaboxcontroller/members";

?>